﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<SDT.Site.ViewModels.ProductSearchModels>" %>
<%@ Import Namespace="SDT.Model" %>
<%@ Import Namespace="SDT.Site.ViewModels" %>
<div class="bar-title" align="center">
    Loại bất động sản
</div>
<div class="tinrao_cate">
    <ul>
        <% if (Model.Categories != null && Model.Categories.Count() > 0)
           {                   
               
               foreach (var c in Model.Categories)
               {
                   var path = string.Format("/product/index/{0}/{1}/{2}/{3}/{4}/{5}/{6}/{7}",
                   Model.TypeID.HasValue ? Model.TypeID.Value : 0,
                   c.ID,
                   Model.CityID.HasValue ? Model.CityID.Value : 0,
                   Model.DistrictID.HasValue ? Model.DistrictID.Value : 0,
                   Model.AreaID.HasValue ? Model.AreaID.Value : 0,
                   Model.PriceID.HasValue ? Model.PriceID.Value : 0,
                   Model.ProjectID.HasValue ? Model.ProjectID.Value : 0,
                   Model.TimeID.HasValue ? Model.TimeID.Value : 0);
                   var css = c.ID == Model.CategoryID ? "act" : string.Empty;
                   if (Model.Keyword != null && Model.Keyword != string.Empty) path = path + "?key=" + Model.Keyword;
                %>
                <li><a href="<%=path %>" class="<%=css %>"><%= c.Name %></a></li>
               <%}
           }%>
    </ul>
</div>
